package com.qianniu.napi.admin.entity;

import com.baomidou.mybatisplus.enums.IdType;

import java.math.BigDecimal;
import java.util.Date;
import com.baomidou.mybatisplus.annotations.TableId;
import com.baomidou.mybatisplus.annotations.TableField;
import com.baomidou.mybatisplus.activerecord.Model;
import com.baomidou.mybatisplus.annotations.TableName;
import java.io.Serializable;

/**
 * <p>
 * 积分日志
 * </p>
 *
 * @author chenxuebin
 * @since 2018-09-04
 */
@TableName("t_jifen_flow")
public class JifenFlow extends Model<JifenFlow> {

	private static final long serialVersionUID = 1L;

	@TableId(value="id", type= IdType.AUTO)
	private Long id;
	/**
	 * 积分数&
	 */
	private BigDecimal num;
	/**
	 * 获取类型@0：注册；1：邀请好友；2：每日签到；3：兑换优惠券；4：分享；5：充值送积分；6：消费返积分；7：获赠积分；8：赠送出去；9：过期失效积分；10：退款扣积分；11：兑换币；12：做任务 13:核销&
	 */
	private Integer jftype;

	@TableField(exist = false)
	private String jftypename;

	/**
	 * #收支方式@1：收入；-1：支出
	 */
	private Integer iotype;
	/**
	 * 备注
	 */
	private String remark;
	private String sn;
	/**
	 * 是否确认
	 */
	@TableField("is_confirm")
	private Integer isConfirm;
	/**
	 * 返佣入账类型@1：支付成功后；2：确认收货|扫码核销后；3：发货15天后到账
	 */
	@TableField("fantime_type")
	private Integer fantimeType;

	/**
	 * 确认时间
	 */
	@TableField("confirm_date")
	private Date confirmDate;

	/**
	 * 生效起始时间
	 */
	@TableField("date_start")
	private Date dateStart;
	/**
	 * 生效截止时间
	 */
	@TableField("date_end")
	private Date dateEnd;
	/**
	 * 有效状态&
	 */
	private Integer state;

	private BigDecimal money;

	private Long ywid;
	private Long uid;
	private Long mid;
	private Long mpid;
	private Long modifier;
	private Date createtime;
	private Date modifytime;

	public Long getId() {
		return id;
	}

	public void setId(Long id) {
		this.id = id;
	}

	public BigDecimal getNum() {
		return num;
	}

	public void setNum(BigDecimal num) {
		this.num = num;
	}

	public Integer getJftype() {
		return jftype;
	}

	public void setJftype(Integer jftype) {
		this.jftype = jftype;
	}

	public Integer getIotype() {
		return iotype;
	}

	public void setIotype(Integer iotype) {
		this.iotype = iotype;
	}

	public String getRemark() {
		return remark;
	}

	public void setRemark(String remark) {
		this.remark = remark;
	}

	public String getSn() {
		return sn;
	}

	public void setSn(String sn) {
		this.sn = sn;
	}

	public Integer getIsConfirm() {
		return isConfirm;
	}

	public void setIsConfirm(Integer isConfirm) {
		this.isConfirm = isConfirm;
	}

	public Date getConfirmDate() {
		return confirmDate;
	}

	public void setConfirmDate(Date confirmDate) {
		this.confirmDate = confirmDate;
	}

	public Date getDateStart() {
		return dateStart;
	}

	public void setDateStart(Date dateStart) {
		this.dateStart = dateStart;
	}

	public Date getDateEnd() {
		return dateEnd;
	}

	public void setDateEnd(Date dateEnd) {
		this.dateEnd = dateEnd;
	}

	public Integer getState() {
		return state;
	}

	public void setState(Integer state) {
		this.state = state;
	}

	public Long getUid() {
		return uid;
	}

	public void setUid(Long uid) {
		this.uid = uid;
	}

	public Long getMid() {
		return mid;
	}

	public void setMid(Long mid) {
		this.mid = mid;
	}

	public Long getMpid() {
		return mpid;
	}

	public void setMpid(Long mpid) {
		this.mpid = mpid;
	}

	public Date getCreatetime() {
		return createtime;
	}

	public void setCreatetime(Date createtime) {
		this.createtime = createtime;
	}

	public Date getModifytime() {
		return modifytime;
	}

	public void setModifytime(Date modifytime) {
		this.modifytime = modifytime;
	}

	public Long getModifier() {
		return modifier;
	}

	public void setModifier(Long modifier) {
		this.modifier = modifier;
	}

	public String getJftypename() {
		if(jftype==null) return "积分";
		if(jftypename!=null)return jftypename;

		switch (jftype){
			case 1:
				jftypename = "注册返积分";
				break;
			case 2:
				jftypename = "兑换积分";
				break;
			case 3:
				jftypename = "分享奖励积分";
				break;
			case 4:
				jftypename = "兑换抵扣积分";
				break;
			case 5:
				jftypename = "签到返积分";
				break;
			case 6:
				jftypename = "获赠积分";
				break;
			case 7:
				jftypename = "购物抵扣积分";
				break;
			case 8:
				jftypename = "积分过期";
				break;
			case 9:
				jftypename = "充值返积分";
				break;
			case 10:
				jftypename = "订单取消退积分";
				break;
			case 11:
				jftypename = "获赠";
				break;
			case 13:
				jftypename = "做任务奖励积分";
				break;
			case 14:
				jftypename = "卖货收积分";
				break;
			case 15:
				jftypename = "核销奖励积分";
				break;
			case 16:
				jftypename = "中奖奖励积分";
				break;
			case 17:
				jftypename = "阅读奖励积分";
				break;
			case 18:
				jftypename = "绑手机奖励积分";
				break;
			case 19:
				jftypename = "会员升级奖励积分";
				break;
			case 20:
				jftypename = "消费奖励积分";
				break;
			case 21:
				jftypename = "商家营收返积分";
				break;
			case 23:
				jftypename = "兑换积分提现";
				break;
			case 24:
				jftypename = "点赞奖励积分";
				break;
			case 25:
				jftypename = "评论奖励积分";
				break;
			case 26:
				jftypename = "预约奖励积分";
				break;
			default:
				jftypename = "未知";
		}
		return jftypename;
	}

	public void setJftypename(String jftypename) {
		this.jftypename = jftypename;
	}

	public Integer getFantimeType() {
		return fantimeType;
	}

	public void setFantimeType(Integer fantimeType) {
		this.fantimeType = fantimeType;
	}

	public Long getYwid() {
		return ywid;
	}

	public void setYwid(Long ywid) {
		this.ywid = ywid;
	}

	public BigDecimal getMoney() {
		return money;
	}

	public void setMoney(BigDecimal money) {
		this.money = money;
	}

	@Override
	protected Serializable pkVal() {
		return this.id;
	}

	@Override
	public String toString() {
		return "JifenFlow{" +
				"id=" + id +
				", num=" + num +
				", jftype=" + jftype +
				", iotype=" + iotype +
				", remark=" + remark +
				", isConfirm=" + isConfirm +
				", confirmDate=" + confirmDate +
				", dateStart=" + dateStart +
				", dateEnd=" + dateEnd +
				", state=" + state +
				", uid=" + uid +
				", mid=" + mid +
				", mpid=" + mpid +
				", createtime=" + createtime +
				", modifytime=" + modifytime +
				"}";
	}
}
